package org.usmile.algorithms.huawei.acm;

import java.math.BigDecimal;
import java.util.Scanner;

// https://blog.csdn.net/qq_34465338/article/details/128835128
public class _几何平均值最大子数组 {
    private static double[] nums;
    private static int L;
    private static double max = 0;
    private static int startIndex = 0;
    private static int size = 0;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        L = sc.nextInt();
        nums = new double[N];
        for (int i = 0; i < N; i++) {
            nums[i] = sc.nextDouble();
        }

        for (int i = 0; i <= nums.length - L; i++) {
            dfs(i, i,0, 1.0);
        }


        System.out.println(startIndex + " " + size);
    }

    private static void dfs(int start, int next, int len, double curr) {
        if (len >= L) {
            double temp = Math.pow(curr, 1.0 / len);
            if (temp > max) {
                max = temp;
                startIndex = start;
                size = len;
            }
        }

        if (next < nums.length) {
            BigDecimal num1 = new BigDecimal(String.valueOf(curr));
            BigDecimal num2 = new BigDecimal(String.valueOf(nums[next]));
            dfs(start, next + 1, len + 1, num1.multiply(num2).doubleValue());
        }
    }
}
